class StaticpagesController < ApplicationController

  def index
    @shadow='home'
    @all_microposts=[]
    @post=current_user.posts.build if is_loged_in?
    #显示用户的所有微博
    # @all_microposts=Post.where("user_id = ?",current_user.id).order(created_at: :desc).paginate(page: params[:page],per_page:4)
    # user=current_user
    # @all_microposts=Post.where("user_id in (?) OR user_id = ?",user.following_ids, user.id).order(created_at: :desc).paginate(page: params[:page],per_page:4)
    @posts=current_user.feeds.order(created_at: :desc).paginate(page: params[:page],per_page:4) if is_loged_in?
  end

  def create

  end

  def new

  end

  def show
  end

  def edit

  end

  def update

  end
  def about
    @shadow='about'
  end
  def help
    @shadow='help'
  end







end
